Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change funnel errors to ExposedHogQLError #24822

Merged
merged 1 commit into from
Sep 11, 2024
Merged

Conversation

aspicer
Copy link
Contributor

@aspicer aspicer commented Sep 5, 2024

Problem

Realized through development environment that non posthog users couldn't see useful funnel errors (this was likely an async query change)

image

Changes

Change all validation errors in funnels to ExposedHogQLError

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Made sure errors surfaced when you weren't a staff user.

@aspicer aspicer requested a review from a team September 5, 2024 18:32
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the more general solution: replacing isinstance(err, ExposedHogQLError | ExposedCHQueryError) with isinstance(err, ExposedHogQLError | ExposedCHQueryError | APIException)? This would allow all ValidationErrors but also e.g. PermissionDenied to pass through, which should be the case, since these DRF exceptions are explicitly expose-able

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems passing ValidationError through is the way – e.g. would automatically solve this issue: #24809 (comment)

@aspicer aspicer force-pushed the aspicer/funnel-errors branch from 0095a61 to 82263bd Compare September 11, 2024 04:39
@aspicer aspicer requested a review from Twixes September 11, 2024 04:40
@aspicer aspicer enabled auto-merge (squash) September 11, 2024 04:40
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@aspicer aspicer merged commit b2e8300 into master Sep 11, 2024
84 checks passed
@aspicer aspicer deleted the aspicer/funnel-errors branch September 11, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants